import 'package:flutter/material.dart';
import 'package:doFlutter/model/link.dart';

class LoginBottomLink extends StatelessWidget {
  static List<LinkModel> _bottomLink = [
    new LinkModel('手机登录', '/', {}),
    new LinkModel('找回密码', '/', {}),
    new LinkModel('关于我们', '/', {}),
  ];
  const LoginBottomLink({Key key}) : super(key: key);
  Widget _viewPage(context, LinkModel link) {
    return FlatButton(
      onPressed: () =>
          {Navigator.pushNamed(context, link.page, arguments: link.args)},
      child: Text(link.text, style: TextStyle(fontSize: 10)),
    );
  }

  Widget _dividerWidget() {
    return Container(
        height: 15,
        child: VerticalDivider(
          width: 1, // 默认线是 1px 的高度，宽度设置的是左右的间距
          // color: Colors.black,
          indent: 0, // 相当于 marginTop
          endIndent: 0, // 相当于 marginBottom
          thickness: 1, // 线的厚度，
        ));
  }

  @override
  Widget build(BuildContext context) {
    return Container(
      child: Row(
        mainAxisAlignment: MainAxisAlignment.spaceAround,
        mainAxisSize: MainAxisSize.min,
        children: [
          _viewPage(context, _bottomLink[0]),
          _dividerWidget(),
          _viewPage(context, _bottomLink[1]),
          _dividerWidget(),
          _viewPage(context, _bottomLink[2]),
        ],
      ),
    );
  }
}
